﻿using JQ50037.ViewModel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace JQ50037.View
{
    /// <summary>
    /// SetParamView.xaml 的交互逻辑
    /// </summary>
    public partial class SetParamView : Window
    {
        public SetParamView()
        {
            InitializeComponent();
            this.DataContext = new SetParamViewModel();
        }

        private void btClose_Click(object sender, RoutedEventArgs e)
        {
            // 可选：关闭屏幕键盘
            if (_oskProcess != null && !_oskProcess.HasExited)
            {
                _oskProcess.Kill();
                _oskProcess = null;
            }
            this.Close();
        }
        private Process _oskProcess;
        private void TextBox_GotFocus(object sender, RoutedEventArgs e)
        {
            if (_oskProcess == null || _oskProcess.HasExited)
            {
                // 启动屏幕键盘
                _oskProcess = Process.Start("osk.exe");
            }
        }

        private void TextBox_LostFocus(object sender, RoutedEventArgs e)
        {
            // 可选：关闭屏幕键盘
            if (_oskProcess != null && !_oskProcess.HasExited)
            {
                _oskProcess.Kill();
                _oskProcess = null;
            }
        }
    }
}